package com.bw.house.model

import com.bw.common.entity.BaseRes
import com.bw.house.api.HouseApiServer
import com.bw.house.entity.HouseEntityItem
import com.bw.house.entity.TenantEntityItem
import javax.inject.Inject

class HouseRepository @Inject constructor(private  val apiServer: HouseApiServer) {
    suspend fun loadHouseData(id:Int):BaseRes<List<HouseEntityItem>>{
        return apiServer.getHouseData(id)
    }

    suspend fun loadTenantData():BaseRes<List<TenantEntityItem>>{
        return apiServer.getTenantData()
    }

    suspend fun loadSearchData(keyword:String):BaseRes<List<TenantEntityItem>>{
        return apiServer.getSearchData(keyword)
    }
}